<%@page contentType="text/html;charset=UTF-8"%>
<%@include file="../common.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Project Infor</title>
	<link href="${ctx}/resources/css/project/project.css" rel="stylesheet">
	<link href="${ctx}/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<link href="${ctx}/resources/css/bootstrap/bootstrap.min.css" rel="stylesheet">
	<link href="${ctx}/resources/css/bootstrap/bootstrapValidator.min.css" rel="stylesheet">
    <script src="${ctx}/resources/js/jquery/jquery-1.12.0.min.js"></script>
    <script src="${ctx}/resources/js/bootstrap/bootstrap.min.js"></script>
	<script src="${ctx}/resources/js/bootstrap/bootstrapValidator.min.js"></script>
	<script src="${ctx}/resources/js/bootstrap/language/zh_CN.js"></script>
	<c:set var="active" value="settings"/>
    <%@include file="../common/head.jsp"%>
</head>
<body>


<div class="p10 bg-fff">
    <div class="ant-breadcrumb">
            <span>
                <span class="ant-breadcrumb-link ">首页</span>
                <span class="ant-breadcrumb-separator">/</span>
            </span>
            <span>
                <a class="ant-breadcrumb-link" href="${ctx}/project/list">项目列表</a>
                <span class="ant-breadcrumb-separator">/</span>
            </span>
            <span >
                <a class="ant-breadcrumb-link" href="${ctx}/version/list?projId=${project.id}">${project.projName}-列表</a>
                <span class="ant-breadcrumb-separator" >/</span>
            </span>
            <span >
                <span class="ant-breadcrumb-link">${version.version}</span>
                <span class="ant-breadcrumb-separator" >/</span>
            </span>
    </div>
</div>


	<div class="container p20">
		<div class="row bg-fff">
	    <%--<%@include file="nav.jsp"%>--%>
		<div class="col-md-10">
			<form accept-charset="UTF-8" action="${ctx}/version/save" class="form-horizontal" id="edit_project" method="post">
                <input type="hidden" name="projId" value="${project.id}" />
                <div style="display:none">
				<input name="id" type="hidden" value="${version.id}">
				</div>
				<fieldset>
				<legend>镜像配置</legend>
				<div class="form-group">
					<label class="control-label" for="version">镜像名</label>
					<div class="col-sm-10">
						<input class="form-control" id="version" name="version" type="text"  <c:if test="${not empty version.version}">readonly</c:if> required value="${version.version}">
						<div class="light">规则：[a-z0-9]+</div>
						<c:if test="${empty version.version}">
							<div class="light">备注：镜像名称定义好之后不能修改。</div>
						</c:if>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" for="homePage">项目地址</label>
					<div class="col-sm-10">
						<input class="form-control" id="homePage" name="homePage" type="text" readonly value="${project.homePage}">
						<div class="light">项目主页</div>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label" for="gitSshUrl">GIT地址</label>
					<div class="col-sm-10">
						<input class="form-control" id="gitSshUrl" name="gitSshUrl" type="text" readonly value="${project.gitSshUrl}">
						<div class="light">案例：git@xxxx/xxx.git</div>
					</div>
				</div>
                <div class="form-group">
                    <label class="control-label" for="branch">分支</label>
                    <div class="col-sm-10">
                        <input class="form-control" id="branch" name="branch" type="text" value="${version.branch}">
                        <div class="light">案例：master</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label" for="changeLog">参数</label>
                    <div class="col-sm-10">
                        <textarea class="form-control" id="changeLog" name="changeLog" rows="4">${version.changeLog}</textarea>
                    </div>
                </div>
				<div class="form-group">
					<label class="control-label" for="description">描述</label>
					<div class="col-sm-10">
						<textarea class="form-control" id="description" name="description" rows="4">${version.description}</textarea>
					</div>
				</div>
				</fieldset>
				<div class="form-actions">
					<button class="btn btn-save btn-sm" name="commit" type="submit"> 保存 </button>
					<a class="btn  btn-sm" href="${ctx}/version/list?projId=${project.id}">返回</a>
				</div>
			</form>
		</div>
</div>
</div>
<script language="javascript">

	$(document).ready(function() {
		$('#edit_project').bootstrapValidator({
			framework: 'bootstrap',
			icon: {
				valid: 'glyphicon glyphicon-ok',
				invalid: 'glyphicon glyphicon-remove',
				validating: 'glyphicon glyphicon-refresh'
			},
			fields: {
				version: {
					validators: {
						regexp: {
							regexp: /^[a-z0-9]+$/,//[a-z0-9]+(?:[._-][a-z0-9]+)*
							message: '镜像名不符合规则.'
						}
					}
				}
			}
		});
	});



</script>
</body>
</html>
